// message_push_index
exports.message_push_index = function(req,res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;

    var resultData = {};

    //任务流创建
    async.waterfall([
        //推送记录
        function (cb) {
            R.SEND_HTTP(
                req,
                {
                    url    : CORE_APIConfig.coreAPI.searchOrganizationMessagePushRecord + "/ompr_type/0/count/1/ompr_oid/" + restfulParams.organization_id + "/ompr_oaid/"+ restfulParams.activity_id,
                    method : 'GET'
                },
                function (err, data) {

                    resultData.messageData = data.data;

                    var messageCount = data.count;

                    if(3-messageCount>0){
                        resultData.messageCount = 3-messageCount;
                    }else{
                        resultData.messageCount = 0;
                    }
                    cb();
                }
            );
        },
        function(cb){
            R.SEND_HTTP(
                req,
                {
                    url    : CORE_APIConfig.coreAPI.searchActivityBrowseRecordFixUser+"/count/1/oabr_oaid/"+ restfulParams.activity_id,
                    method : "GET"
                },
                function (err, data) {

                    resultData.selectedUserCount = data.count;

                    cb();
                }
            );
        },



    ],function(err, result){

        //返回最终拼接结果
        RES.response(res,true,resultData);

    });
}